//
//  MainTableViewController.swift
//  Weibo
//
//  Created by 明丽 on 16/1/11.
//  Copyright © 2016年 明丽. All rights reserved.
//

import UIKit


class MainTableViewController : UITableViewController , visitorLoginViewDelegate{
    
    var userLogin = UserAccountViewController().userLogin
    
    var visitroLoginView : VisitorLogin?
    let myRrfrsh = WBREfreshControl()
    override func loadView() {
        
        if userLogin {
            
            super.loadView()
        }
        else{
            
            visitroLoginView = VisitorLogin()
            // v.backgroundColor = UIColor.redColor()
            //设置代理
            visitroLoginView?.visitorViewDelegate=self
            view = visitroLoginView
        }
    }
    //    override func viewWillLayoutSubviews() {
    //        super.viewWillLayoutSubviews()
    //
    //    }
    //
    
    
    //MARK: 实现代理方法
    func userWillRegister() {
        print("我是注册")
    }
    
    func userWillLogin() {
        
        let oauth = OAuthViewController()
        let nav = UINavigationController(rootViewController: oauth)
        //        跳转到授权页面
        presentViewController(nav, animated: true, completion: nil)
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
}
